package com.soa.zuul.util;

import org.springframework.util.StringUtils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
import com.google.gson.JsonParser;

public class Json {
	public static Gson GSON = new GsonBuilder().setExclusionStrategies(new JsonExclusionStrategy()).setPrettyPrinting().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
	public static Gson GSON2 = new GsonBuilder().setPrettyPrinting().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
    public static boolean isGoodJson(String json) {  
        if (StringUtils.isEmpty(json)) {  
            return false;  
        }  
        try {  
            new JsonParser().parse(json);  
            return true;  
        } catch (JsonParseException e) {  
            return false;  
        }  
    }
}
